﻿import QtQuick 2.12
import QtQuick.Window 2.12
import QtQuick.Layouts 1.1
import QtQuick.Controls.Styles 1.2
import QtQuick.Controls 2.12
import QtMultimedia 5.14

Window {
    title: "通信日志"
    width: 800*dp
    height: 650*dp
    maximumWidth: 800*dp
    maximumHeight: 650*dp
    minimumWidth: 800*dp
    minimumHeight: 650*dp
    Connections{  // qmlre
        target: CMaintenance
        onDellog:{
            logtab.setData(CMaintenance.getLog())
        }
    }
    Connections{  // qmlre
        target: CSignal
        onRefCommunicationLog:{
            logtab.setData(CMaintenance.getLog())
        }
    }
    Item{
        anchors.fill: parent
        height: parent.height
        Rectangle{
            y:20*dp; x: 20*dp
            Text {
                text: qsTr("通信日志")
                font.bold: true
                font.pixelSize: config.fontsize + 3*dp
            }
        }
        PushButton{
            x:parent.width-140*dp
            y:20*dp
            button_icon: "qrc:/picture/br_qc.png"
            title: "清除"
            width: 60*dp
            text_color: "#1677FF"
            icon_height: 20*dp
            icon_width: 20*dp
            onReleased: {
                CMaintenance.delLog()
            }
        }
        PushButton{
            x:parent.width-70*dp
            y:20*dp
            button_icon: "qrc:/picture/bt_dc.png"
            title: "导出"
            width: 60*dp
            text_color: "#1677FF"
            icon_height: 20*dp
            icon_width: 20*dp
            onReleased: {
                CMaintenance.exportLog()
            }
        }
        Rectangle{
            x: 20*dp
            y:65*dp
            color: "#B8B7B5"
            width: parent.width-2*x
            height: parent.height-70*dp
            DataLog{
                id:logtab
            }
        }
    }
}
